package org.doubango.FrCall.Screens;
//package org.douban.frcall;

import org.doubango.FrCall.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;

public class SearchFriendNearbyPage extends Activity {
	private Spinner selectCountry;
	private Spinner selectProvince;
	private Spinner selectCity;
	private Spinner selectDistrict;
	private Button nearbyOk;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ViewGroup.LayoutParams para = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
		addContentView(LayoutInflater.from(SearchFriendNearbyPage.this).inflate(R.layout.search_friend_nearby, null), para);
		selectCountry = (Spinner) findViewById(R.id.select_country);
		selectProvince = (Spinner) findViewById(R.id.select_province);
		selectCity = (Spinner) findViewById(R.id.select_city);
		selectDistrict = (Spinner) findViewById(R.id.select_district);
		nearbyOk = (Button) findViewById(R.id.nearby_ok);
		
		ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(SearchFriendNearbyPage.this, R.layout.select_country_item, R.id.select_country, new String[]{"中国", "英国", "美国"});
		selectCountry.setAdapter(adapter1);
		
		ArrayAdapter<String> adapter2 = new ArrayAdapter<String>(SearchFriendNearbyPage.this, R.layout.select_province_item, R.id.select_province, new String[]{"北京", "上海", "广东"});
		selectProvince.setAdapter(adapter2);
		
		ArrayAdapter<String> adapter3 = new ArrayAdapter<String>(SearchFriendNearbyPage.this, R.layout.select_city_item, R.id.select_city, new String[]{"北京", "上海"});
		selectCity.setAdapter(adapter3);
		
		ArrayAdapter<String> adapter4 = new ArrayAdapter<String>(SearchFriendNearbyPage.this, R.layout.select_district_item, R.id.select_district, new String[]{"朝阳", "海淀"});
		selectDistrict.setAdapter(adapter4);
		
		nearbyOk.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(SearchFriendNearbyPage.this, ShowSearchedFriendInfo.class);
				startActivity(intent);
			}
		});
		
	}
	
}
